package com.fuchuang.seckillsystem.vo;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.ToString;

//公共返回对象枚举对象
@Getter
@ToString
@AllArgsConstructor
public enum RespBeanEnum {
    
    //通用
    SUCCESS(200, "SUCCESS"),
    ERROR(500, "服务端异常"),
    TOKEN_EXPIRED_ERROR(600, "令牌过期"),
    TOKEN_ERROR(601, "token解析错误"),
    PARAMS_ERROR(700, "参数错误"),
    JSON_ERROR(710, "json格式错误"),
    REQUEST_ERROR(800, "请求频繁"),
    UPDATE_ERROR(900, "更新失败"),
    DELETE_ERROR(901, "删除失败"),
    ADD_ERROR(902, "添加失败"),
    
    
    //用户模块
    REGISTER_ERROR(1000, "注册失败"),
    IDCARD_HAST_EXIST(1001, "身份证已注册"),
    IDENTITY_ERROR(1002, "身份认证失败"),
    USERNAME_HAS_EXIST_ERROR(1003, "用户名已存在"),
    LOGIN_ERROR(1004, "登录失败"),
    USERNAME_NOT_EXIST_ERROR(1005, "用户名不存在"),
    PASSWORD_ERROR(1006, "密码错误"),
    USER_NOT_EXIST_ERROR(1007, "用户不存在"),
    
    //商品模块
    GOODS_INSERT_ERROR(2001, "商品添加失败"),
    GOODS_DELETE_ERROR(2002, "商品删除失败"),
    GOODS_UPDATE_ERROR(2003, "商品更改失败"),
    GOODS_NOT_EXIST_ERROR(2004, "商品不存在"),
    GOODS_IN_ACTIVITY(2005, "商品正在秒杀服务里"),
    
    //秒杀活动模块
    ACTIVITY_INSERT_ERROR(3001, "活动添加失败"),
    ACTIVITY_DELETE_ERROR(3002, "活动删除失败"),
    ACTIVITY_UPDATE_ERROR(3003, "活动更改失败"),
    ACTIVITY_NOT_EXIST_ERROR(3004, "活动不存在"),
    ACTIVITY_GOODS_ADD_REPEAT_ERROR(3005, "活动商品重复添加"),
    GOODS_IN_OTHER_ACTIVITIES(3006, "该商品已在其他秒杀活动里"),
    ACTIVITY_HAS_EXPIRED(3007, "秒杀活动已过期"),
    ACTIVITY_IS_SECKILL(3008, "活动正在秒杀"),
    
    //秒杀模块
    SECKILL_ERROR(4000, "秒杀失败"),
    PATH_ERROR(4001, "秒杀路径错误"),
    STOCK_ERROR(4002, "库存为空"),
    REPEAT_ERROR(4003, "重复抢购"),
    SECKILL_NOT_START(4004, "秒杀活动未开启"),
    SECKILL_AUTH_ERROR(4005, "用户无权购买次产品"),
    //订单模块
    ORDER_NOT_EXIST_ERROR(5001, "订单不存在"),
    ORDER_PAY_ERROR(5002, "订单支付失败"),
    ORDER_CANCEL_ERROR(5003, "订单取消失败"),
    ORDER_AUTH_ERROR(5004, "该订单非该用户所属"),
    
    ACCOUNT_MONEY_ERROR(6000, "账号金额不足"),
    EXCEL_ERROR(7000, "表格生成失败");
    
    
    private final Integer code;
    private final String message;
}
